##Author: Guangfu Wang.

function(Grab_main_executable_files ALL_SRC_FILES)
    message(STATUS "Grabing all files for compilation...")

    set(prefix "${CMAKE_SOURCE_DIR}/ShapeAnalysis/src")
    file(GLOB ALGORITHMS_FILES ${prefix}/algorithms/*.cpp ${prefix}/algorithms/*.hpp ${prefix}/algorithms/*.c ${prefix}/algorithms/*.h)
    file(GLOB GUI_FILES ${prefix}/gui/*.cpp ${prefix}/gui/*.hpp ${prefix}/gui/*.c ${prefix}/gui/*.h)
    file(GLOB KERNEL_FILES ${prefix}/kernels/*.cpp ${prefix}/kernels/*.hpp ${prefix}/kernels/*.c ${prefix}/kernels/*.h)
    file(GLOB MODEL_LOADER_FILES ${prefix}/model_loader/*.cpp ${prefix}/model_loader/*.hpp ${prefix}/model_loader/*.c ${prefix}/model_loader/*.h)
    file(GLOB OPERATORS_FILES ${prefix}/operators/*.cpp ${prefix}/operators/*.hpp ${prefix}/operators/*.c ${prefix}/operators/*.h)
    file(GLOB SHADER_FILES ${prefix}/shaders/*.*)
    file(GLOB UTIL_FILES ${prefix}/util/*.cpp ${prefix}/util/*.hpp ${prefix}/util/*.c ${prefix}/util/*.h)
    file(GLOB DEF_FILE ${prefix}/def.hpp)

    foreach(p_al ${ALGORITHMS_FILES})
        list(APPEND ${ALL_SRC_FILES} ${p_al})
    endforeach(p_al ${ALGORITHMS_FILES})

    foreach(p_ui ${GUI_FILES})
        list(APPEND ${ALL_SRC_FILES} ${p_ui})
    endforeach(p_ui ${GUI_FILES})

    foreach(p_k ${KERNEL_FILES})
        list(APPEND ${ALL_SRC_FILES} ${p_k})
    endforeach(p_k ${KERNEL_FILES})

    foreach(p_model ${MODEL_LOADER_FILES})
        list(APPEND ${ALL_SRC_FILES} ${p_model})
    endforeach(p_model ${MODEL_LOADER_FILES})

    foreach(p_op ${OPERATORS_FILES})
        list(APPEND ${ALL_SRC_FILES} ${p_op})
    endforeach(p_op ${OPERATORS_FILES})

    foreach(p_shader ${SHADER_FILES})
        list(APPEND ${ALL_SRC_FILES} ${p_shader})
    endforeach(p_shader ${SHADER_FILES})

    foreach(p_util ${UTIL_FILES})
        list(APPEND ${ALL_SRC_FILES} ${p_util})
    endforeach(p_util ${UTIL_FILES})

    foreach(p_def ${DEF_FILE})
        list(APPEND ${ALL_SRC_FILES} ${p_def})
    endforeach(p_def ${DEF_FILE})

    list(LENGTH ${ALL_SRC_FILES} NUM_FILES)
    message(STATUS "Globing all source files, number of files: ${NUM_FILES}")
endfunction(Grab_main_executable_files ALL_SRC_FILES)

function(Grab_util_lib_files ALL_UTIL_LIB_SRC_FILES)

endfunction()